package design.mode.model.builder.director;

import design.mode.model.builder.common.Builder;
import design.mode.model.builder.product.type.Bike;

/**
 * @description 指挥者类，指挥Builder去造车
 * @since jdk11
 */
public class Director {
    private Builder builder;

    public Director(Builder builder) {
        this.builder = builder;
    }

    /**
     * 组装车
     *
     * @return 车
     */
    public Bike construct() {
        builder.buildFrame();
        builder.buildSeat();
        return builder.createBike();
    }
}
